﻿using J.FoodManageSet.Application.Command.GroupingCommand;
using J.FoodManageSet.Application.Command.SpecificationCommand;
using MediatR;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;

namespace J.FoodManageSet.Controllers
{
    [Route("api/[controller]/[action]")]
    [ApiController]
    public class GroupingController : ControllerBase
    {
        private readonly IMediator _mediator;

        public GroupingController(IMediator mediator)
        {
            _mediator = mediator;
        }
        /// <summary>
        /// 菜品分组添加或修改
        /// </summary>
        [HttpPost]
        public async Task<int> GroupingAddUpdate(GroupingAddCommand command)
        {
            return await _mediator.Send(command);
        }
        /// <summary>
        /// 菜品分组删除
        /// </summary>
        [HttpPost]
        public async Task<int> GroupingDelete(GroupingDeleteCommand command)
        {
            return await _mediator.Send(command);
        }
        /// <summary>
        /// 菜品分组字段删除
        /// </summary>
        [HttpPost]
        public async Task<int> GroupingDeleteid(GroupingCommand command)
        {
            return await _mediator.Send(command);
        }
    }
}
